home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / debug / gdb / libiberty / strdup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-26  |  172 b   |  11 lines

  1. char *
  2. strdup(s)
  3.      char *s;
  4. {
  5.     char *result = (char*)malloc(strlen(s) + 1);
  6.     if (result == (char*)0)
  7.     return (char*)0;
  8.     strcpy(result, s);
  9.     return result;
  10. }
  11.